
if(document.getElementById('yezhubendi')){
	var xuanzcity;
	var xuanzeID;
	var citynum;
	var city;
	 var url0 = basepath+'/form/city.do';
		var data0 = {city:"0531"};
		$.ajax({
	        url:url0,
	        async:false,
	        type:"post",
	        data:data0,
	        success:function(result){
	        	console.log(result);
	        	citynum = result.data.city.dicKey;
	        	xuanzcity = result.data.city.dicKey;
	        	var cityArray = result.data.listCity;
	        	city = result.data.city.dicText;
	        	$("#selecity").append("<option value='"+citynum+"'>"+city+"</option>");
            for(var i = 0;i < cityArray.length;i++){
          	  var dickty = cityArray[i].dicKey;
          	  var dicText = cityArray[i].dicText;
          	 if(citynum == dickty){
          		 
          	 }else{
          		 $("#selecity").append("<option value='"+dickty+"'>"+dicText+"</option>");
          	 }
          	 
          	 
            }
	       }
	    });
	
		function seldctXCity(select){
			var sel = document.getElementById('selecity');
			var selected_val = sel.options[sel.selectedIndex].value;
			
			xuanzcity = selected_val;
		}
	var bigId;
	var middleId;
	var smallId;
	
	//大类
	var url = basepath+'/shop/typeBig.do';
	  $.ajax({
	        url:url,
	        async:false,
	        type:"get",
	        success:function(result){
	        	console.log(result);
	        	var carray = result.data;
	        	$('.yezhudalei').empty();
	        	for(var i = 0;i < carray.length;i++){
	        		 $('.yezhudalei').append("<p class='woshi"+i+" woshi' onclick='zhonglei("+carray[i].typeBigId+","+i+")' >"+carray[i].typeBigName+"</p>");
	      
	        			 $('.woshi0').css({
	    	        		 background:'#b2bfa1',
	    		               color:'#fff'
	    	        	})
	        		
	        	}
	        	//中类
	        	zhonglei(carray[0].typeBigId,0);
	        }
	    });
	  
	  
	  function zhonglei(bigid,bigi){
		  
		  var dom;
			var vs = $('.yezhudalei p');
			var num = vs.length;
		
			for (var i = 0; i < num; i++) {
			  !function(i){
			     
			        $('.woshi'+i).click(function(){
			        	//console.log(i);
			        	 if (i == 0) {
					            $('.woshi0').css({
					               background:'#b2bfa1',
					               color:'#fff'
					               })
					    
					      }else{
					            $('.woshi0').css({
					           background:'#fff',
					           color:'#000'
					            })  
					      }
			        	 
			        	
			        	
			       !!dom ? dom.style.color = "":0;
			             !!dom ? dom.style.background = "":0;
			             this.style.color = "#fff";
			             this.style.background = "#b2bfa1";
			             dom = this;
			      });
			      
			  }(i);
			}
			$('#divp').empty();
		  var urlzhong = basepath+'/shop/typeMiddle.do';
		  console.log(bigid);
			 var data = {bigId:bigid};
		  $.ajax({
			  url:urlzhong,
		        async:false,
		        type:"post",
		        data:data,
		        success:function(result){
		        	console.log(result);
		        	var barray = result.data;
		        	for(var i = 0;i < barray.length;i++){
		        		 $('#divp').append("<p class='wr"+i+" woshi' onclick='xiaolei("+barray[i].typeMiddleId+","+i+")' >"+barray[i].typeMiddleName+"</p>");
		      
		        			 $('.wr0').css({
		    	        		 background:'#b2bfa1',
		    		               color:'#fff'
		    	        	})
		        		
		        	}
		        	//小类
		        	xiaolei(barray[0].typeMiddleId,0);
		        }
		    });
	  }
	  function xiaolei(middleId,midi){
		  
		  var dom;
			var vs = $('#divp p');
			var num = vs.length;
		
			for (var i = 0; i < num; i++) {
			  !function(i){
			     
			        $('.wr'+i).click(function(){
			        	//console.log(i);
			        	 if (i == 0) {
					            $('.wr0').css({
					               background:'#b2bfa1',
					               color:'#fff'
					               })
					    
					      }else{
					            $('.wr0').css({
					           background:'#fff',
					           color:'#000'
					            })  
					      }
			        	 
			        	
			        	
			       !!dom ? dom.style.color = "":0;
			             !!dom ? dom.style.background = "":0;
			             this.style.color = "#fff";
			             this.style.background = "#b2bfa1";
			             dom = this;
			      });
			      
			  }(i);
		  
			}
		  
			$('#threfen').empty();
		  var url = basepath+'/shop/typeSmall.do';
		  var data = {middleId:middleId};
		  $.ajax({
		        url:url,
		        async:false,
		        type:"post",
		        data:data,
		        success:function(result){
		        	console.log(result);
		        	var ziarray = result.data;
		        	for(var i = 0;i < ziarray.length;i++){
		        		 $('#threfen').append("<p class= 'threed"+i+" threed' onclick='xiaoaleclick("+ziarray[i].typeSmallId+","+i+")'>"+ziarray[i].typeSmallName+"</p>");
		        			
		        	}
		    	
		       }
		       
		    });
	  }
	  function xiaoaleclick(smallId,smalli){
		  xuanzeID = smallId;
		  localStorage.setItem("xuanzeID", xuanzeID);
		  localStorage.setItem("xuanzcity", xuanzcity);
		  window.location.href=basepath + "/yezhu/YZ_BD_SearchXQ.do";
	}
	  
	function searchclick(){
		var valueshuru;
		valueshuru = $('.shuruk').val();
		if(!$('.shuruk').val()){
			alert('请输入要查询的商品');
		}else{
			 localStorage.setItem("valueshuru", valueshuru);
			 window.location.href=basepath + "/yezhu/YZ_BD_SearchNameXQ.do";
		}
		
	}
	  
	  
}

//关键字搜索
if(document.getElementById('guanjianzisoux')){
	var guanjianzi;
	guanjianzi =  localStorage.getItem("valueshuru");
	var startPage;
	var firstPage;
	var lastPage;
	var meiShopArray;
	 var url = basepath+'/goods/likeGoods.do';
	 startPage = '1';
	 $('.prePage').click(function(){
		 startPage --;
		 if(startPage < firstPage){
			 startPage = firstPage;
		 }
		 
		 requestGoodsList();
	 })
	 //下一页
	
	 $('.nextPage').click(function(){
		 startPage ++;
		 if(startPage > lastPage){
			 startPage = lastPage;
		 }
		 
		 requestGoodsList();
	 })
	 //首页
	 $('.firstPage').click(function(){
		 startPage = firstPage;
		 requestGoodsList();
	 })
	 //尾页
	  $('.lastPage').click(function(){
		 startPage = lastPage;
		 requestGoodsList();
	 })
	 //请求
	 requestGoodsList();
		
		function requestGoodsList(){
			var data = {word:guanjianzi,city:'0531',startPage:startPage,pageSize:'10'};
			$.ajax({
		        url:url,
		        async:false,
		        type:"post",
		        data:data,
		        success:function(result){
		        	console.log(result);
		       	var sparray = result.data.list;
		        	meiShopArray = result.data.list;
		        	var pricearray;
		        	var numberSarray = [];
		        	$('.spzshi').empty();
		        	for(var i = 0;i < sparray.length;i++){
		        		
		        		pricearray = sparray[i].goodsModel;
		        		for(var j = 0;j < pricearray.length;j++){
		        			numberSarray.push(pricearray[j].price);
		        		}
		        		numberSarray.sort(compare);
		        	
		        		var div = $('<div class="renwuliebiao" onclick="tiaozhuan('+sparray[i].id+','+i+')"></div>');
		        		var dl = $('<dl class="jianjiansha"></dl>');
		        		var dt = $('<dt class="adtouxiang"></dt>');
		        		var dd= $('<dd class="renwuxinxi"></dd>')
		        		var dd2 = $('<dd class="addright"></dd>')
		        		var imgg = $('<img id="imgg'+i+'" src = '+basepath+'/attachment/'+sparray[i].imgUrl+'.do>');
		        		dt.append(imgg);
		        		console.log(sparray[i].imgUrl);
		        		dd.append('<p class="name">'+sparray[i].name+'</p> '+'<p class="addkucun">库存量:<span>'+sparray[i].amount+'</span></p>'+'<p class="anlishu">销量:<span>'+sparray[i].sales+'</span> 万</p>'+'<p class="linian">配送费:<span>'+sparray[i].sendPrice+'元／公里</span></p>'+'<p class="phone">￥'+numberSarray[i]+'</p>');
		        		if(sparray[i].isOpenPin == 0){
		        			dd2.append('<p class="yikaiqipd">拼</p>'+'<p class="rightt"></p>');
		        		}else{
		        			dd2.append('<p class="weikaiqipd"></p>'+'<p class="rightt"></p>');
		        		}  		
		        		div.append(dl);
		        		dl.append(dt);
		        		dl.append(dd);
		        		dl.append(dd2);
		        		 $('.spzshi').append(div);
		        		
		        	}	
		        	//分页
		        	var fenarray = result.data;
		        	var znumber = fenarray.pageNum;//总页数
		        	var currentye = fenarray.pages;//当前页
		        	firstPage = fenarray.firstPage;//首页
		        	lastPage = fenarray.lastPage//尾页
		        	
	       		 $('.zongnumber').html(currentye+'/'+znumber);
		       }
		
		    });
		}
		
		function compare(value1, value2) {

			   if (value1 < value2) {

			       return -1;

			   } else if (value1 > value2) {

			       return 1;

			   } else {

			       return 0;

			   }

			}
		//跳转
		function tiaozhuan(sid,p){
			var xarray = meiShopArray[p];
			var str = JSON.stringify(xarray);
        	localStorage.setItem("xarray",str);
        	
			window.location.href=basepath + "/yezhu/YZ_SP_GoodsXQ.do";
		}
	 
	 
	 
	 
}

//点击小类搜索
if(document.getElementById('yezhushapixiang')){
	var xuanid = localStorage.getItem("xuanzeID");
	var xuancit = localStorage.getItem("xuanzcity");
	var startPage;
	var firstPage;
	var lastPage;
	var meiShopArray;
	console.log(xuanid);
	console.log(xuancit);

	
	 var url = basepath+'/yezhuGoods/listGoodsBySmallId.do';
	 startPage = '1';
	 //上一页
	 
	 $('.prePage').click(function(){
		 startPage --;
		 if(startPage < firstPage){
			 startPage = firstPage;
		 }
		 
		 requestGoodsList();
	 })
	 //下一页
	
	 $('.nextPage').click(function(){
		 startPage ++;
		 if(startPage > lastPage){
			 startPage = lastPage;
		 }
		 
		 requestGoodsList();
	 })
	 //首页
	 $('.firstPage').click(function(){
		 startPage = firstPage;
		 requestGoodsList();
	 })
	 //尾页
	  $('.lastPage').click(function(){
		 startPage = lastPage;
		 requestGoodsList();
	 })
	 //请求
	 requestGoodsList();
		
		function requestGoodsList(){
			var data = {smallId:xuanid,city:xuancit,startPage:startPage,pageSize:'10'};
			$.ajax({
		        url:url,
		        async:false,
		        type:"post",
		        data:data,
		        success:function(result){
		        	console.log(result);
		        	var sparray = result.data.list;
		        	meiShopArray = result.data.list;
		        	var pricearray;
		        	var numberSarray = [];
		        	$('.spzshi').empty();
		        	
		        	for(var i = 0;i < sparray.length;i++){
		        		
		        		pricearray = sparray[i].goodsModel;
		        		for(var j = 0;j < pricearray.length;j++){
		        			numberSarray.push(pricearray[j].price);
		        		}
		        		numberSarray.sort(compare);
		        	
		        		var div = $('<div class="renwuliebiao" onclick="tiaozhuan('+sparray[i].id+','+i+')"></div>');
		        		var dl = $('<dl class="jianjiansha"></dl>');
		        		var dt = $('<dt class="adtouxiang"></dt>');
		        		var dd= $('<dd class="renwuxinxi"></dd>')
		        		var dd2 = $('<dd class="addright"></dd>')
		        		var imgg = $('<img id="imgg'+i+'" src = '+basepath+'/attachment/'+sparray[i].imgUrl+'.do>');
		        		dt.append(imgg);
		        		
		        		console.log(sparray[i].imgUrl);
		        		dd.append('<p class="name">'+sparray[i].name+'</p> '+'<p class="addkucun">库存量:<span>'+sparray[i].amount+'</span></p>'+'<p class="anlishu">销量:<span>'+sparray[i].sales+'</span> 万</p>'+'<p class="linian">配送费:<span>'+sparray[i].sendPrice+'元／公里</span></p>'+'<p class="phone">￥'+numberSarray[i]+'</p>');
		        		if(sparray[i].isOpenPin == 0){
		        			dd2.append('<p class="yikaiqipd">拼</p>'+'<p class="rightt"></p>');
		        		}else{
		        			dd2.append('<p class="weikaiqipd"></p>'+'<p class="rightt"></p>');
		        		}  		
		        		div.append(dl);
		        		dl.append(dt);
		        		dl.append(dd);
		        		dl.append(dd2);
		        		 $('.spzshi').append(div);
		        		
		        	}	
		        	//分页
		        	var fenarray = result.data;
		        	var znumber = fenarray.pageNum;//总页数
		        	var currentye = fenarray.pages;//当前页
		        	firstPage = fenarray.firstPage;//首页
		        	lastPage = fenarray.lastPage//尾页
		        	
	       		 $('.zongnumber').html(currentye+'/'+znumber);
		       }
		
		    });
		}
		
		function compare(value1, value2) {

			   if (value1 < value2) {

			       return -1;

			   } else if (value1 > value2) {

			       return 1;

			   } else {

			       return 0;

			   }

			}
		
		
		function tiaozhuan(sid,p){
			var xarray = meiShopArray[p];
			var str = JSON.stringify(xarray);
        	localStorage.setItem("xarray",str);
        	
			window.location.href=basepath + "/yezhu/YZ_SP_GoodsXQ.do";
		}
	
		
		
}

//添加到购物车

if(document.getElementById('shangouciaxiagq')){
	var bianl;
	var str =  localStorage.getItem("xarray");
	var sarray = new Array();
	var numbpricSarray = new Array();
	sarray = JSON.parse(str);
	
	console.log('库存量');
	console.log(sarray);
	
	var picarray = sarray.goodsModel;
	 var picaddarray = [];
	 for(var i = 0;i < picarray.length; i ++){
		 picaddarray.push(picarray[i].imgUrl);
	 }
	 console.log(picaddarray);
	for(var j = 0; j < picaddarray.length;j ++){
		var img = $('<img id="dtupianzd" class="shangpindatu" src='+basepath+'/attachment/'+picaddarray[j]+'.do>')
		var imgg = $('<img src='+basepath+'/attachment/'+picaddarray[j]+'.do>')
	     var div = $('<div class="swiper-slide"></div>');
		  div.append(img);
	     $('.swiper-wrapper').append(div);
	     $('.tupiande').append(imgg);
	     
	}
	 var mySwiper2 = new Swiper ('.swiper-container', {
		    direction: 'horizontal',
		    loop: true,
		    pagination: {
		        el: '.swiper-pagination',
		        type: 'fraction',
		      },
		  }) 
	 for(var p = 0;p < picarray.length;p++){
		var pi = $('<p  class="subbiote'+p+' subbiote" onclick="xuanzdcllick('+p+')"><span class="guigecs">'+picarray[p].model+'</span><span class="guigecs">'+picarray[p].size+'</span><span class="guigecs">'+picarray[p].color+'</span><span class="guigecs">'+picarray[p].price+'元</span></p>');
	    $('.guigecaip').append(pi);
	    xuanzdcllick();
	 }
	$('#spinname').html(sarray.name);
	var kuciunnumber = sarray.amount;
    $('.kuziunlamount').text(sarray.amount);
    $('.kupeisongf').text(sarray.sendPrice+'元/公里');
    $('.feixlieisname').text(sarray.typeSmallName);
    $('.spinmiaoshud').text(sarray.description);
    for(var j = 0;j < picarray.length;j++){
		numbpricSarray.push(picarray[j].price);
	}
    numbpricSarray.sort(compare);
    $('.shopprice').text('¥：'+numbpricSarray[numbpricSarray.length-1]+'~'+numbpricSarray[0]+"/"+sarray.unit);
    var numer = 1;
    function jiaclick(){
       numer ++;
       $('.xian').val(numer);
    }
    function jianclick(){
    	if (numer > 1) {
          numer --;
          $('.xian').val(numer);
    	}
    }
    //存储选择的数据
    function xuanzdcllick(i){
    	 $('.shopprice').text('¥：'+numbpricSarray[i]+'/'+sarray.unit);
    	 var dom;
			var vs = $('.guigecaip p');
			var num = vs.length;
		 
			for (var i = 0; i < num; i++) {
			  !function(i){
			     
			        $('.subbiote'+i).click(function(){
			        	//console.log(i);
			        	 if (i == 0) {
					            $('.subbiote0').css({
					               background:'#b2bfa1',
					               color:'#fff'
					               })
					    
					      }else{
					            $('.subbiote0').css({
					           background:'#fff',
					           color:'#000'
					            })  
					      }
			        	 
			       !!dom ? dom.style.color = "":0;
			             !!dom ? dom.style.background = "":0;
			             this.style.color = "#fff";
			             this.style.background = "#b2bfa1";
			             dom = this;
			      });
			      
			  }(i);
		  
			}
   }
}

/*//购物车
var bb = 0;
$('.gouwucheshanp').click(function(){
	if (bb == 0) {
		$('.xuwance').css({
		 background: "url(../images/hongdui.png)",
		 backgroundSize:'contain'
	})
		bb = 1;
	}else{
		$('.xuwance').css({
		 background: "url(../images/raw_1503991404.png)",
		 backgroundSize:'contain'
	})
		bb = 0;
	}
	
})	
var tt = 0;
$('.quantu').click(function(){
	if (tt == 0) {
		$('.quantu').css({
		 background: "url(../images/hongdui.png)",
		 backgroundSize:'contain'
	})
		$('.xuwance').css({
		 background: "url(../images/hongdui.png)",
		 backgroundSize:'contain'
	})
		tt = 1;
	}else{
		$('.quantu').css({
		 background: "url(../images/raw_1503991404.png)",
		 backgroundSize:'contain'
	})
		$('.xuwance').css({
		 background: "url(../images/raw_1503991404.png)",
		 backgroundSize:'contain'
	})
		tt = 0;
	}
})
//选择地址
$('.dizi').click(function(){
	 window.location.href = "YZ_GWC_SelectAdress.html";
})

$('.dizxuanz').click(function(){
	 window.location.href = "YZ_GWC_TijiaoTick.html";
})
//添加地址

$('.adddizi').click(function(){
	 window.location.href = "YZ_GWC_ADDAdress.html";
})
//保存地址
$('.addbaocun').click(function(){
	 window.location.href = "YZ_GWC_SelectAdress.html";
})
// 厂家直销
var chajgia = localStorage.getItem("chanjia"); */

/*// 搜素
var chsousuo;
//建材市场详情
$('.renwuliebiao').click(function(){
	// chsousuo = 1;
	//   localStorage.setItem("chsousuo", "1");
    window.location.href = "CLS_SP_BDShopJXQ.html";
})
$('.chajianzhixiaosousuo').click(function(){
    // chsousuo = 0;
    // localStorage.setItem("chsousuo", "0");
    window.location.href = "CLS_SP_ZXShopJXQ.html";
})
$('.pidansalist').click(function(){
    // chsousuo = 2;
    // localStorage.setItem("chsousuo", "2");
    window.location.href = "CLS_SP_PPShopJXQ.html";
})*/
// var chsousuole = localStorage.getItem("chsousuo"); 
// if (chsousuole == 0) {
//   $('.changjiazhixiaosalist').css({
//     display:'block'
//   })
//   $('.bendishangjia').css({
//     display:'none'
//   })
//   $('.pindansalist').css({
//     display:'none'
//   })
// }else if (chsousuole == 1){
// 	$('.bendishangjia').css({
//     display:'block'
//   })
//   $('.changjiazhixiaosalist').css({
//     display:'none'
//   })
//   $('.pindansalist').css({
//     display:'none'
//   })
// }else if (chsousuole == 2){
// $('.pindansalist').css({
//     display:'block'
//   })
//   $('.changjiazhixiaosalist').css({
//     display:'none'
//   })
//   $('.bendishangjia').css({
//     display:'none'
//   })
// }

var jiancai;
$('.jinanhuangtai').click(function(){
   //    jiancai = 0;
	  // localStorage.setItem("jiancai", "0");
      window.location.href = "CLS_BD_JCSCXQing.html";
	 
})
$('.hongixnmeikl').click(function(){
	
   //    jiancai = 1;
	  // localStorage.setItem("jiancai", "1");
      window.location.href = "CLS_PP_JCSCQing.html";
	 
})
// var jiancaisc = localStorage.getItem("jiancai");
// if (jiancaisc == 1) {
// 	// hongixngmikail();
// 	$('.pinpaijianca').css({
//     display:'block'
//   })
//   $('.bendijianca').css({
//     display:'none'
//   })
// }else{
// 	$('.bendijianca').css({
//     display:'block'
//   })
//   $('.pinpaijianca').css({
//     display:'none'
//   })
// }
//建材市场详情数据请求
// function hongixngmikail(){
//     $.ajax({
//     	type : "GET",  //提交方式  
//         url :"http://114.215.99.229:8080/timely-rain-api/goods_shop/type/list?_token=a4126b4e4e6f4b2c8500db69a470f0e5",//路径  
//         data : '',//数据，这里使用的是Json格式进行传输
//         dataType:'jsonp', 
//         jsonp: "jsonpCallback",//服务端用于接收callback调用的function名的参数  
//          success : function(data) {//返回数据根据结果进行相应的处理  
          
//             alert("Result:"+data.result)
       
//      }
//     })
// }


//是地图片
var shidi;
$('.zhuangtai').click(function(e){
	 e.stopPropagation(); 
      
     shidi = 0;
	 localStorage.setItem("shidi", "0");
	 window.location.href = "YZ_QuSMap.html";
	
})
$('.chakanshidi').click(function(e){
	 shidi = 0;
	 localStorage.setItem("shidi", "0");
	 window.location.href = "YZ_QuSMap.html";
})

if( document.getElementById("shidimap") ){
	var shituditp = localStorage.getItem("shidi");
    if (shituditp == 0) {
	$('.shiditu').FlyZommImg();
    }
}

//建材市场
if( document.getElementById("jiancaishciang")){
	var qulei = new Array("7","一区：门窗类","二区：地板类","三区：厨卫类","四区：水电暖类","五区：板材类","六区：壁纸类","七区：新型材料类");
    for (var i = 0; i < qulei.length - 1; i++) {
    	$('#daqubendi').append("<p class='daqufenlei"+i+"' style='float:left;width:3.277rem;height:0.8rem;text-align: center;line-height: 0.8rem;border:0.5px solid #e5e5e5;'>"+qulei[i + 1]+"</p>");
      $('.daqufenlei0').css({
	   background:'#b2bfa1',
	   color:'#fff'
     })
    }
   document.getElementById("qudfeii").innerText = qulei[0];
   bendiselectchange();


function bendiselectchange(){
 var vs = $('#daqubendi p');
 var dom;
var num = vs.length;
for (var i = 0; i < num; i++) {
	!function(i){
    
      	$('.daqufenlei'+i).click(function(){
      		
      		document.getElementById("chaakndyiwqu").innerText = i + 1;
      		leixingchange(i);
      	if (i = 0) {
      	 $('.daqufenlei0').click(function(){
      	 		$('.daqufenlei0').css({
	             background:'#b2bfa1',
	             color:'#fff'
               })
      	 })
      }else{
      	    $('.daqufenlei0').css({
	         background:'#fff',
	         color:'#000'
            }) 	
      }
			 !!dom ? dom.style.color = "":0;
             !!dom ? dom.style.background = "":0;
             this.style.color = "#fff";
             this.style.background = "#b2bfa1";
             dom = this;
      });
      
	}(i);
	
}

var foodlist = new Array({
		"imaeurl":"http://fuzhoutest.scity.cn/image/get/system/default/01eeac42fbfcb1699b848e787e8af955.jpg",
		"shopName":"商家以",
		"xiaoshoue":"800",
		"shangpinzhong":"32",
		"dianhua":"199999999999"

	},
	{
		"imaeurl":"http://fuzhoutest.scity.cn/image/get/system/default/01eeac42fbfcb1699b848e787e8af955.jpg",
		"shopName":"商家er",
		"xiaoshoue":"800",
		"shangpinzhong":"32",
		"dianhua":"199999999999"

	},
	{
		"imaeurl":"http://fuzhoutest.scity.cn/image/get/system/default/01eeac42fbfcb1699b848e787e8af955.jpg",
		"shopName":"商家伞",
		"xiaoshoue":"800",
		"shangpinzhong":"32",
		"dianhua":"199999999999"

	},
	{
		"imaeurl":"http://fuzhoutest.scity.cn/image/get/system/default/01eeac42fbfcb1699b848e787e8af955.jpg",
		"shopName":"商家四",
		"xiaoshoue":"800",
		"shangpinzhong":"32",
		"dianhua":"199999999999"

	},
	{
		"imaeurl":"http://fuzhoutest.scity.cn/image/get/system/default/01eeac42fbfcb1699b848e787e8af955.jpg",
		"shopName":"商家勿",
		"xiaoshoue":"800",
		"shangpinzhong":"32",
		"dianhua":"199999999999"

	},
	{
		"imaeurl":"http://fuzhoutest.scity.cn/image/get/system/default/01eeac42fbfcb1699b848e787e8af955.jpg",
		"shopName":"商家了",
		"xiaoshoue":"800",
		"shangpinzhong":"32",
		"dianhua":"199999999999"

	}
	);
function leixingchange(i){
	 console.log(i);
	$('#shejishllie').empty();
	for (var i = 0; i < foodlist.length; i++) {
		var divw = $('<div class="renwuliebiao" onclick="dingdanxiangqing('+i+')"></div>');
        var dlli = $('<dl></dl>');
        var dtt = $('<dt class="touxiang"></dt>');
           var imagetou = $('<img id="shangjiatouxiang" src="'+foodlist[i].imaeurl+'">')
        var ddd = $('<dd class="renwuxinxi"></dd>')
           var namea = $('<p class="name"><b>'+foodlist[i].shopName+'</b></p>'+'<p class="zhuangtai">查看商家图片</p>');
           var anlishu = $('<p class="anlishu">销售额：<span>'+foodlist[i].xiaoshoue+'</span>万</p>') 
           var linnian = $('<p class="linian">商品种类数：<span>'+foodlist[i].shangpinzhong+'</span></p>');
           var dianhua = $('<p class="phone">电话：<span>'+foodlist[i].dianhua+'</span></p>')
          divw.append(dlli);
           dlli.append(dtt);
         ddd.append(namea);
         ddd.append(anlishu);
         ddd.append(linnian);
         ddd.append(dianhua);
        dlli.append(ddd);
        dtt.append(imagetou);
       
       
		$('#shejishllie').append(divw);
	
	}
	
  }
 }
}



